\part{库}
\label{part-libraries}

{\Large \emph{by Till Tantau}}


\bigskip
\noindent
%In this part the library packages are documented. They provide additional predefined graphic objects like new arrow heads or new plot marks, but sometimes also extensions of the basic \pgfname\ or \tikzname\ system. The libraries are not loaded by default since many users will not need them.
在这一部分中，介绍了库。 它们提供了其他预定义的图形对象，例如新的箭头或新的地标，有些地方还提供了基本\pgfname\ 或\tikzname\ 系统的扩展。 默认情况下不加载库，因为许多用户不会需要到它们。

\medskip
\noindent
\begin{codeexample}[graphic=white,preamble={\usetikzlibrary{arrows,trees}}]
\tikzset{
  ld/.style={level distance=#1},lw/.style={line width=#1},
  level 1/.style={ld=4.5mm, trunk,          lw=1ex ,sibling angle=60},
  level 2/.style={ld=3.5mm, trunk!80!leaf a,lw=.8ex,sibling angle=56},
  level 3/.style={ld=2.75mm,trunk!60!leaf a,lw=.6ex,sibling angle=52},
  level 4/.style={ld=2mm,   trunk!40!leaf a,lw=.4ex,sibling angle=48},
  level 5/.style={ld=1mm,   trunk!20!leaf a,lw=.3ex,sibling angle=44},
  level 6/.style={ld=1.75mm,leaf a,         lw=.2ex,sibling angle=40},
}
\pgfarrowsdeclare{leaf}{leaf}
  {\pgfarrowsleftextend{-2pt} \pgfarrowsrightextend{1pt}}
{
  \pgfpathmoveto{\pgfpoint{-2pt}{0pt}}
  \pgfpatharc{150}{30}{1.8pt}
  \pgfpatharc{-30}{-150}{1.8pt}
  \pgfusepathqfill
}

\newcommand{\logo}[5]
{
  \colorlet{border}{#1}
  \colorlet{trunk}{#2}
  \colorlet{leaf a}{#3}
  \colorlet{leaf b}{#4}
  \begin{tikzpicture}
    \scriptsize\scshape
    \draw[border,line width=1ex,yshift=.3cm,
          yscale=1.45,xscale=1.05,looseness=1.42]
      (1,0) to [out=90, in=0]    (0,1)  to [out=180,in=90]  (-1,0)
            to [out=-90,in=-180] (0,-1) to [out=0,  in=-90] (1,0) -- cycle;

    \coordinate (root) [grow cyclic,rotate=90]
    child {
      child [line cap=round] foreach \a in {0,1} {
        child foreach \b in {0,1} {
          child foreach \c in {0,1} {
            child foreach \d in {0,1} {
              child foreach \leafcolor in {leaf a,leaf b}
                { edge from parent [color=\leafcolor,-#5] }
        } } }
      } edge from parent [shorten >=-1pt,serif cm-,line cap=butt]
    };

    \node [align=center,below] at (0pt,-.5ex)
    { \textcolor{border}{T}heoretical \\ \textcolor{border}{C}omputer \\
      \textcolor{border}{S}cience };
  \end{tikzpicture}
}
\begin{minipage}{3cm}
  \logo{green!80!black}{green!25!black}{green}{green!80}{leaf}\\
  \logo{green!50!black}{black}{green!80!black}{red!80!green}{leaf}\\
  \logo{red!75!black}{red!25!black}{red!75!black}{orange}{leaf}\\
  \logo{black!50}{black}{black!50}{black!25}{}
\end{minipage}
\end{codeexample}

\iffalse
\include{parts/Libraries/sections/pgfmanual-en-library-3d}
\include{parts/Libraries/sections/pgfmanual-en-library-angles}
\include{parts/Libraries/sections/pgfmanual-en-library-arrows}
\include{parts/Libraries/sections/pgfmanual-en-library-automata}
\include{parts/Libraries/sections/pgfmanual-en-library-babel}
\include{parts/Libraries/sections/pgfmanual-en-library-backgrounds}
\include{parts/Libraries/sections/pgfmanual-en-library-bbox}
\include{parts/Libraries/sections/pgfmanual-en-library-calc}
\include{parts/Libraries/sections/pgfmanual-en-library-calendar}
\include{parts/Libraries/sections/pgfmanual-en-library-chains}
\include{parts/Libraries/sections/pgfmanual-en-library-circuits}
\include{parts/Libraries/sections/pgfmanual-en-library-decorations}
\include{parts/Libraries/sections/pgfmanual-en-library-er}
\include{parts/Libraries/sections/pgfmanual-en-library-external}
\include{parts/Libraries/sections/pgfmanual-en-library-fadings}
\include{parts/Libraries/sections/pgfmanual-en-library-fit}
\include{parts/Libraries/sections/pgfmanual-en-library-fixedpoint}
\include{parts/Libraries/sections/pgfmanual-en-library-fpu}
\include{parts/Libraries/sections/pgfmanual-en-library-lsystems}
\include{parts/Libraries/sections/pgfmanual-en-library-math}
\include{parts/Libraries/sections/pgfmanual-en-library-matrices}\fi
\include{parts/Libraries/sections/pgfmanual-en-library-mindmaps}
\iffalse
\include{parts/Libraries/sections/pgfmanual-en-library-folding}
\include{parts/Libraries/sections/pgfmanual-en-library-patterns}
\include{parts/Libraries/sections/pgfmanual-en-library-perspective}
\include{parts/Libraries/sections/pgfmanual-en-library-petri}
\include{parts/Libraries/sections/pgfmanual-en-library-plot-handlers}
\include{parts/Libraries/sections/pgfmanual-en-library-plot-marks}
\include{parts/Libraries/sections/pgfmanual-en-library-profiler}
\include{parts/Libraries/sections/pgfmanual-en-library-rdf}
\include{parts/Libraries/sections/pgfmanual-en-library-shadings}
\include{parts/Libraries/sections/pgfmanual-en-library-shadows}
\include{parts/Libraries/sections/pgfmanual-en-library-shapes}
\include{parts/Libraries/sections/pgfmanual-en-library-spy}
\include{parts/Libraries/sections/pgfmanual-en-library-svg-path}
\include{parts/Libraries/sections/pgfmanual-en-library-edges}
\include{parts/Libraries/sections/pgfmanual-en-library-through}
\include{parts/Libraries/sections/pgfmanual-en-library-trees}
\include{parts/Libraries/sections/pgfmanual-en-library-turtle}
\include{parts/Libraries/sections/pgfmanual-en-library-views}\fi

\clearpage